Class FCMRegistrar


  • public class FCMRegistrar
    extends java.lang.Object
    Device registration class for Firebase Messaging
    • Constructor Summary

      Constructors 
      Constructor Description
      FCMRegistrar()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.android.gms.tasks.Task<java.lang.String> getToken()
      Invokes FCM's getToken, which creates the new deviceToken if one does not exist.
      void registerDevice​(OnInitCallback onInitCallback)
      FCM Device registration method which starts registration by trying to access deviceToken, and waits for FCM to finish registration or throw exception
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FCMRegistrar

        public FCMRegistrar()
    • Method Detail

      • getToken

        public com.google.android.gms.tasks.Task<java.lang.String> getToken()
        Invokes FCM's getToken, which creates the new deviceToken if one does not exist.
        Returns:
        Task with token
      • registerDevice

        public void registerDevice​(@NonNull
                                   OnInitCallback onInitCallback)
        FCM Device registration method which starts registration by trying to access deviceToken, and waits for FCM to finish registration or throw exception
        Parameters:
        onInitCallback - : optional callback provided by app to receive device registration status